﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LEET.CommonInterfaces.Compilers;
using LEET.LEETCommon.Model;
using LEET.LEETCommon;
using LEET.CommonInterfaces.TestControls;

namespace LEET.StandardModuals.Instructions
{
    public class EmbeddedScript : Instruction
    {
        String ScriptName {get;set;}

        public EmbeddedScript(String [] args)
            : base(args)
        {
            ScriptName = args[1].Trim();
            InstructionType = NodeTypes.EMBED_TYPE;
            Name = ScriptName;
        }

        public static IAutomationActionResult Embed()
        {
            //TODO
            return null;
        }

        public override String RenderStaticCall()
        {
            //TODO
            return "LEET.StandardModuals.Instructions.EmbeddedScript.Embed()";
        }

        [Obsolete("This should now be replaced by RenderStaticCall", false)]
        protected override string MethodBody(AssertionSet asserts)
        {
            return "                TestScript script = new "+ScriptName+"();\r\n" +
                   "                return new AutomationActionResult(script);\r\n";
        }

        [Obsolete("This should now be replaced by RenderStaticCall", false)]
        protected override string RenderedMethodName(int i)
        {
            return "Run_" + ScriptName + "_" + i;
        }

        public override string PlainText()
        {
            return "Run embedded script " + ScriptName;
        }
    }
}
